package demo;

public class Operation {
    private Movie[] movies;
    public Operation(Movie[] movies) {
        this.movies = movies;
    }
    public void disPlay(){
        for (int i = 0; i < movies.length; i++) {
            System.out.println("-----------------------------");
            System.out.println("电影名字："+movies[i].getName());
            System.out.println("电影价格："+movies[i].getPrice());
            System.out.println("电影评分："+movies[i].getScore());
            System.out.println("-----------------------------");
        }
    }

    public void check(int id){
        for (int i = 0; i < movies.length; i++) {
            if (id == movies[i].getId()){
                System.out.println("电影详情信息：");
                System.out.println("电影名字："+movies[i].getName());
                System.out.println("电影价格："+movies[i].getPrice());
                System.out.println("电影评分："+movies[i].getScore());
                System.out.println("电影导演："+movies[i].getDirector());
                System.out.println("电影演员："+movies[i].getActor());
                System.out.println("电影想看人数："+movies[i].getInfo());
                return;
            }
        }
        System.out.println("没有该电影信息");
    }
}
